<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>similarity</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/androguard/">Androguard</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;similarity
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="similarity-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="similarity-module.html">Module similarity</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># This file is part of Androguard.</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) 2010, Anthony Desnos &lt;desnos at t0t0.org&gt;</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"># All rights reserved.</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"># Androguard is free software: you can redistribute it and/or modify</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"># it under the terms of the GNU Lesser General Public License as published by</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"># the Free Software Foundation, either version 3 of the License, or</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"># (at your option) any later version.</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"># Androguard is distributed in the hope that it will be useful,</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"># GNU Lesser General Public License for more details.</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"># You should have received a copy of the GNU Lesser General Public License</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment"># along with Androguard.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">hashlib</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">ctypes</tt> <tt class="py-keyword">import</tt> <tt class="py-name">cdll</tt><tt class="py-op">,</tt> <tt class="py-name">c_float</tt><tt class="py-op">,</tt> <tt class="py-name">c_int</tt><tt class="py-op">,</tt> <tt class="py-name">c_uint</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt><tt class="py-op">,</tt> <tt class="py-name">Structure</tt><tt class="py-op">,</tt> <tt class="py-name">addressof</tt><tt class="py-op">,</tt> <tt class="py-name">create_string_buffer</tt><tt class="py-op">,</tt> <tt class="py-name">cast</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-comment">#struct libsimilarity {</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-comment">#   void *orig;</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-comment">#   unsigned int size_orig;</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-comment">#   void *cmp;</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-comment">#   unsigned size_cmp;</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-comment">#   unsigned int *corig;</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-comment">#   unsigned int *ccmp;</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-comment">#   </tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment">#   float res;</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-comment">#};</tt> </tt>
<a name="LIBSIMILARITY_T"></a><div id="LIBSIMILARITY_T-def"><a name="L34"></a><tt class="py-lineno"> 34</tt> <a class="py-toggle" href="#" id="LIBSIMILARITY_T-toggle" onclick="return toggle('LIBSIMILARITY_T');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="similarity.LIBSIMILARITY_T-class.html">LIBSIMILARITY_T</a><tt class="py-op">(</tt><tt class="py-base-class">Structure</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="LIBSIMILARITY_T-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="LIBSIMILARITY_T-expanded"><a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">    <tt id="link-0" class="py-name" targets="Variable similarity.LIBSIMILARITY_T._fields_=similarity.LIBSIMILARITY_T-class.html#_fields_"><a title="similarity.LIBSIMILARITY_T._fields_" class="py-name" href="#" onclick="return doclink('link-0', '_fields_', 'link-0');">_fields_</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">"orig"</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-string">"size_orig"</tt><tt class="py-op">,</tt> <tt class="py-name">c_uint</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-string">"cmp"</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-string">"size_cmp"</tt><tt class="py-op">,</tt> <tt class="py-name">c_uint</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-string">"corig"</tt><tt class="py-op">,</tt> <tt class="py-name">c_uint</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-string">"ccmp"</tt><tt class="py-op">,</tt> <tt class="py-name">c_uint</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-string">"res"</tt><tt class="py-op">,</tt> <tt class="py-name">c_float</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">               <tt class="py-op">]</tt> </tt>
</div><a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt id="link-1" class="py-name" targets="Variable similarity.ZLIB_COMPRESS=similarity-module.html#ZLIB_COMPRESS"><a title="similarity.ZLIB_COMPRESS" class="py-name" href="#" onclick="return doclink('link-1', 'ZLIB_COMPRESS', 'link-1');">ZLIB_COMPRESS</a></tt> <tt class="py-op">=</tt>         <tt class="py-number">0</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt id="link-2" class="py-name" targets="Variable similarity.BZ2_COMPRESS=similarity-module.html#BZ2_COMPRESS"><a title="similarity.BZ2_COMPRESS" class="py-name" href="#" onclick="return doclink('link-2', 'BZ2_COMPRESS', 'link-2');">BZ2_COMPRESS</a></tt> <tt class="py-op">=</tt>          <tt class="py-number">1</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt id="link-3" class="py-name" targets="Variable similarity.SMAZ_COMPRESS=similarity-module.html#SMAZ_COMPRESS"><a title="similarity.SMAZ_COMPRESS" class="py-name" href="#" onclick="return doclink('link-3', 'SMAZ_COMPRESS', 'link-3');">SMAZ_COMPRESS</a></tt> <tt class="py-op">=</tt>         <tt class="py-number">2</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt id="link-4" class="py-name" targets="Variable similarity.LZMA_COMPRESS=similarity-module.html#LZMA_COMPRESS"><a title="similarity.LZMA_COMPRESS" class="py-name" href="#" onclick="return doclink('link-4', 'LZMA_COMPRESS', 'link-4');">LZMA_COMPRESS</a></tt> <tt class="py-op">=</tt>         <tt class="py-number">3</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt id="link-5" class="py-name" targets="Variable similarity.XZ_COMPRESS=similarity-module.html#XZ_COMPRESS"><a title="similarity.XZ_COMPRESS" class="py-name" href="#" onclick="return doclink('link-5', 'XZ_COMPRESS', 'link-5');">XZ_COMPRESS</a></tt> <tt class="py-op">=</tt>           <tt class="py-number">4</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt id="link-6" class="py-name" targets="Variable similarity.SNAPPY_COMPRESS=similarity-module.html#SNAPPY_COMPRESS"><a title="similarity.SNAPPY_COMPRESS" class="py-name" href="#" onclick="return doclink('link-6', 'SNAPPY_COMPRESS', 'link-6');">SNAPPY_COMPRESS</a></tt> <tt class="py-op">=</tt>       <tt class="py-number">5</tt> </tt>
<a name="SIMILARITY"></a><div id="SIMILARITY-def"><a name="L52"></a><tt class="py-lineno"> 52</tt> <a class="py-toggle" href="#" id="SIMILARITY-toggle" onclick="return toggle('SIMILARITY');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html">SIMILARITY</a> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SIMILARITY-expanded"><a name="SIMILARITY.__init__"></a><div id="SIMILARITY.__init__-def"><a name="L53"></a><tt class="py-lineno"> 53</tt> <a class="py-toggle" href="#" id="SIMILARITY.__init__-toggle" onclick="return toggle('SIMILARITY.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">=</tt><tt class="py-string">"./libsimilarity/libsimilarity.so"</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.__init__-expanded"><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt> <tt class="py-op">=</tt> <tt class="py-name">cdll</tt><tt class="py-op">.</tt><tt class="py-name">LoadLibrary</tt><tt class="py-op">(</tt> <tt class="py-name">path</tt> <tt class="py-op">)</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method similarity.SIMILARITY.compress()=similarity.SIMILARITY-class.html#compress"><a title="similarity.SIMILARITY.compress" class="py-name" href="#" onclick="return doclink('link-7', 'compress', 'link-7');">compress</a></tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">c_uint</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method similarity.SIMILARITY.ncd()=similarity.SIMILARITY-class.html#ncd"><a title="similarity.SIMILARITY.ncd" class="py-name" href="#" onclick="return doclink('link-8', 'ncd', 'link-8');">ncd</a></tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">c_int</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method similarity.SIMILARITY.ncs()=similarity.SIMILARITY-class.html#ncs"><a title="similarity.SIMILARITY.ncs" class="py-name" href="#" onclick="return doclink('link-9', 'ncs', 'link-9');">ncs</a></tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">c_int</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method similarity.SIMILARITY.cmid()=similarity.SIMILARITY-class.html#cmid"><a title="similarity.SIMILARITY.cmid" class="py-name" href="#" onclick="return doclink('link-10', 'cmid', 'link-10');">cmid</a></tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">c_int</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method similarity.SIMILARITY.entropy()=similarity.SIMILARITY-class.html#entropy"><a title="similarity.SIMILARITY.entropy" class="py-name" href="#" onclick="return doclink('link-11', 'entropy', 'link-11');">entropy</a></tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">c_float</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method similarity.SIMILARITY.levenshtein()=similarity.SIMILARITY-class.html#levenshtein"><a title="similarity.SIMILARITY.levenshtein" class="py-name" href="#" onclick="return doclink('link-12', 'levenshtein', 'link-12');">levenshtein</a></tt><tt class="py-op">.</tt><tt class="py-name">restype</tt> <tt class="py-op">=</tt> <tt class="py-name">c_uint</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_level</tt> <tt class="py-op">=</tt> <tt class="py-number">9</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt> <tt class="py-op">=</tt> <tt id="link-13" class="py-name" targets="Class similarity.LIBSIMILARITY_T=similarity.LIBSIMILARITY_T-class.html"><a title="similarity.LIBSIMILARITY_T" class="py-name" href="#" onclick="return doclink('link-13', 'LIBSIMILARITY_T', 'link-13');">LIBSIMILARITY_T</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__caches</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">           <tt id="link-14" class="py-name"><a title="similarity.ZLIB_COMPRESS" class="py-name" href="#" onclick="return doclink('link-14', 'ZLIB_COMPRESS', 'link-1');">ZLIB_COMPRESS</a></tt> <tt class="py-op">:</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">           <tt id="link-15" class="py-name"><a title="similarity.BZ2_COMPRESS" class="py-name" href="#" onclick="return doclink('link-15', 'BZ2_COMPRESS', 'link-2');">BZ2_COMPRESS</a></tt> <tt class="py-op">:</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">           <tt id="link-16" class="py-name"><a title="similarity.SMAZ_COMPRESS" class="py-name" href="#" onclick="return doclink('link-16', 'SMAZ_COMPRESS', 'link-3');">SMAZ_COMPRESS</a></tt> <tt class="py-op">:</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">           <tt id="link-17" class="py-name"><a title="similarity.LZMA_COMPRESS" class="py-name" href="#" onclick="return doclink('link-17', 'LZMA_COMPRESS', 'link-4');">LZMA_COMPRESS</a></tt> <tt class="py-op">:</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">           <tt id="link-18" class="py-name"><a title="similarity.XZ_COMPRESS" class="py-name" href="#" onclick="return doclink('link-18', 'XZ_COMPRESS', 'link-5');">XZ_COMPRESS</a></tt> <tt class="py-op">:</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">           <tt id="link-19" class="py-name"><a title="similarity.SNAPPY_COMPRESS" class="py-name" href="#" onclick="return doclink('link-19', 'SNAPPY_COMPRESS', 'link-6');">SNAPPY_COMPRESS</a></tt> <tt class="py-op">:</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">        <tt class="py-op">}</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Method similarity.SIMILARITY.set_compress_type()=similarity.SIMILARITY-class.html#set_compress_type"><a title="similarity.SIMILARITY.set_compress_type" class="py-name" href="#" onclick="return doclink('link-20', 'set_compress_type', 'link-20');">set_compress_type</a></tt><tt class="py-op">(</tt> <tt id="link-21" class="py-name"><a title="similarity.ZLIB_COMPRESS" class="py-name" href="#" onclick="return doclink('link-21', 'ZLIB_COMPRESS', 'link-1');">ZLIB_COMPRESS</a></tt> <tt class="py-op">)</tt> </tt>
</div><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.set_level"></a><div id="SIMILARITY.set_level-def"><a name="L78"></a><tt class="py-lineno"> 78</tt> <a class="py-toggle" href="#" id="SIMILARITY.set_level-toggle" onclick="return toggle('SIMILARITY.set_level');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#set_level">set_level</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">level</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.set_level-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.set_level-expanded"><a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_level</tt> <tt class="py-op">=</tt> <tt class="py-name">level</tt> </tt>
</div><a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.get_in_caches"></a><div id="SIMILARITY.get_in_caches-def"><a name="L81"></a><tt class="py-lineno"> 81</tt> <a class="py-toggle" href="#" id="SIMILARITY.get_in_caches-toggle" onclick="return toggle('SIMILARITY.get_in_caches');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#get_in_caches">get_in_caches</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.get_in_caches-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.get_in_caches-expanded"><a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt> <tt class="py-op">:</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__caches</tt><tt class="py-op">[</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">]</tt><tt class="py-op">[</tt> <tt class="py-name">hashlib</tt><tt class="py-op">.</tt><tt class="py-name">md5</tt><tt class="py-op">(</tt> <tt class="py-name">s</tt> <tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">hexdigest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">]</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt> <tt class="py-op">:</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">c_uint</tt><tt class="py-op">(</tt> <tt class="py-number">0</tt> <tt class="py-op">)</tt> </tt>
</div><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.add_in_caches"></a><div id="SIMILARITY.add_in_caches-def"><a name="L87"></a><tt class="py-lineno"> 87</tt> <a class="py-toggle" href="#" id="SIMILARITY.add_in_caches-toggle" onclick="return toggle('SIMILARITY.add_in_caches');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#add_in_caches">add_in_caches</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s</tt><tt class="py-op">,</tt> <tt class="py-param">v</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.add_in_caches-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.add_in_caches-expanded"><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-name">h</tt> <tt class="py-op">=</tt> <tt class="py-name">hashlib</tt><tt class="py-op">.</tt><tt class="py-name">md5</tt><tt class="py-op">(</tt> <tt class="py-name">s</tt> <tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">hexdigest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">h</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__caches</tt><tt class="py-op">[</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__caches</tt><tt class="py-op">[</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">]</tt><tt class="py-op">[</tt> <tt class="py-name">h</tt> <tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">v</tt> </tt>
</div><a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.clear_caches"></a><div id="SIMILARITY.clear_caches-def"><a name="L92"></a><tt class="py-lineno"> 92</tt> <a class="py-toggle" href="#" id="SIMILARITY.clear_caches-toggle" onclick="return toggle('SIMILARITY.clear_caches');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#clear_caches">clear_caches</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.clear_caches-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.clear_caches-expanded"><a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-22" class="py-name" targets="Variable analysis.i=analysis-module.html#i,Variable jvm.i=jvm-module.html#i"><a title="analysis.i
jvm.i" class="py-name" href="#" onclick="return doclink('link-22', 'i', 'link-22');">i</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__caches</tt> <tt class="py-op">:</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__caches</tt><tt class="py-op">[</tt><tt id="link-23" class="py-name"><a title="analysis.i
jvm.i" class="py-name" href="#" onclick="return doclink('link-23', 'i', 'link-22');">i</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
</div><a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.compress"></a><div id="SIMILARITY.compress-def"><a name="L96"></a><tt class="py-lineno"> 96</tt> <a class="py-toggle" href="#" id="SIMILARITY.compress-toggle" onclick="return toggle('SIMILARITY.compress');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#compress">compress</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.compress-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.compress-expanded"><a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt id="link-24" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.res=similarity.LIBSIMILARITY_T-class.html#res"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-24', 'res', 'link-24');">res</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="similarity.SIMILARITY.compress" class="py-name" href="#" onclick="return doclink('link-25', 'compress', 'link-7');">compress</a></tt><tt class="py-op">(</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_level</tt><tt class="py-op">,</tt> <tt class="py-name">cast</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-26" class="py-name"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-26', 'res', 'link-24');">res</a></tt> </tt>
</div><a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY._sim"></a><div id="SIMILARITY._sim-def"><a name="L100"></a><tt class="py-lineno">100</tt> <a class="py-toggle" href="#" id="SIMILARITY._sim-toggle" onclick="return toggle('SIMILARITY._sim');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#_sim">_sim</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">,</tt> <tt class="py-param">s2</tt><tt class="py-op">,</tt> <tt class="py-param">func</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY._sim-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY._sim-expanded"><a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.orig=similarity.LIBSIMILARITY_T-class.html#orig"><a title="similarity.LIBSIMILARITY_T.orig" class="py-name" href="#" onclick="return doclink('link-27', 'orig', 'link-27');">orig</a></tt> <tt class="py-op">=</tt> <tt class="py-name">cast</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt> <tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.size_orig=similarity.LIBSIMILARITY_T-class.html#size_orig"><a title="similarity.LIBSIMILARITY_T.size_orig" class="py-name" href="#" onclick="return doclink('link-28', 'size_orig', 'link-28');">size_orig</a></tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">s1</tt><tt class="py-op">)</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.cmp=similarity.LIBSIMILARITY_T-class.html#cmp"><a title="similarity.LIBSIMILARITY_T.cmp" class="py-name" href="#" onclick="return doclink('link-29', 'cmp', 'link-29');">cmp</a></tt> <tt class="py-op">=</tt> <tt class="py-name">cast</tt><tt class="py-op">(</tt> <tt class="py-name">s2</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt> <tt class="py-op">)</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.size_cmp=similarity.LIBSIMILARITY_T-class.html#size_cmp"><a title="similarity.LIBSIMILARITY_T.size_cmp" class="py-name" href="#" onclick="return doclink('link-30', 'size_cmp', 'link-30');">size_cmp</a></tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">s2</tt><tt class="py-op">)</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt id="link-31" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.corig=similarity.LIBSIMILARITY_T-class.html#corig"><a title="similarity.LIBSIMILARITY_T.corig" class="py-name" href="#" onclick="return doclink('link-31', 'corig', 'link-31');">corig</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Method similarity.SIMILARITY.get_in_caches()=similarity.SIMILARITY-class.html#get_in_caches"><a title="similarity.SIMILARITY.get_in_caches" class="py-name" href="#" onclick="return doclink('link-32', 'get_in_caches', 'link-32');">get_in_caches</a></tt><tt class="py-op">(</tt><tt class="py-name">s1</tt><tt class="py-op">)</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt id="link-33" class="py-name" targets="Variable similarity.LIBSIMILARITY_T.ccmp=similarity.LIBSIMILARITY_T-class.html#ccmp"><a title="similarity.LIBSIMILARITY_T.ccmp" class="py-name" href="#" onclick="return doclink('link-33', 'ccmp', 'link-33');">ccmp</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name"><a title="similarity.SIMILARITY.get_in_caches" class="py-name" href="#" onclick="return doclink('link-34', 'get_in_caches', 'link-32');">get_in_caches</a></tt><tt class="py-op">(</tt><tt class="py-name">s2</tt><tt class="py-op">)</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name"><a title="similarity.LIBSIMILARITY_T.corig" class="py-name" href="#" onclick="return doclink('link-35', 'corig', 'link-31');">corig</a></tt> <tt class="py-op">=</tt> <tt class="py-name">addressof</tt><tt class="py-op">(</tt> <tt id="link-36" class="py-name"><a title="similarity.LIBSIMILARITY_T.corig" class="py-name" href="#" onclick="return doclink('link-36', 'corig', 'link-31');">corig</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="similarity.LIBSIMILARITY_T.ccmp" class="py-name" href="#" onclick="return doclink('link-37', 'ccmp', 'link-33');">ccmp</a></tt> <tt class="py-op">=</tt> <tt class="py-name">addressof</tt><tt class="py-op">(</tt> <tt id="link-38" class="py-name"><a title="similarity.LIBSIMILARITY_T.ccmp" class="py-name" href="#" onclick="return doclink('link-38', 'ccmp', 'link-33');">ccmp</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">        <tt class="py-name">ret</tt> <tt class="py-op">=</tt> <tt class="py-name">func</tt><tt class="py-op">(</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_level</tt><tt class="py-op">,</tt> <tt class="py-name">addressof</tt><tt class="py-op">(</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name" targets="Method similarity.SIMILARITY.add_in_caches()=similarity.SIMILARITY-class.html#add_in_caches"><a title="similarity.SIMILARITY.add_in_caches" class="py-name" href="#" onclick="return doclink('link-39', 'add_in_caches', 'link-39');">add_in_caches</a></tt><tt class="py-op">(</tt><tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt id="link-40" class="py-name"><a title="similarity.LIBSIMILARITY_T.corig" class="py-name" href="#" onclick="return doclink('link-40', 'corig', 'link-31');">corig</a></tt><tt class="py-op">)</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="similarity.SIMILARITY.add_in_caches" class="py-name" href="#" onclick="return doclink('link-41', 'add_in_caches', 'link-39');">add_in_caches</a></tt><tt class="py-op">(</tt><tt class="py-name">s2</tt><tt class="py-op">,</tt> <tt id="link-42" class="py-name"><a title="similarity.LIBSIMILARITY_T.ccmp" class="py-name" href="#" onclick="return doclink('link-42', 'ccmp', 'link-33');">ccmp</a></tt><tt class="py-op">)</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__libsim_t</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-43', 'res', 'link-24');">res</a></tt> </tt>
</div><a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.ncd"></a><div id="SIMILARITY.ncd-def"><a name="L119"></a><tt class="py-lineno">119</tt> <a class="py-toggle" href="#" id="SIMILARITY.ncd-toggle" onclick="return toggle('SIMILARITY.ncd');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#ncd">ncd</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">,</tt> <tt class="py-param">s2</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.ncd-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.ncd-expanded"><a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name" targets="Method similarity.SIMILARITY._sim()=similarity.SIMILARITY-class.html#_sim"><a title="similarity.SIMILARITY._sim" class="py-name" href="#" onclick="return doclink('link-44', '_sim', 'link-44');">_sim</a></tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">s2</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="similarity.SIMILARITY.ncd" class="py-name" href="#" onclick="return doclink('link-45', 'ncd', 'link-8');">ncd</a></tt> <tt class="py-op">)</tt> </tt>
</div><a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.ncs"></a><div id="SIMILARITY.ncs-def"><a name="L122"></a><tt class="py-lineno">122</tt> <a class="py-toggle" href="#" id="SIMILARITY.ncs-toggle" onclick="return toggle('SIMILARITY.ncs');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#ncs">ncs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">,</tt> <tt class="py-param">s2</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.ncs-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.ncs-expanded"><a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="similarity.SIMILARITY._sim" class="py-name" href="#" onclick="return doclink('link-46', '_sim', 'link-44');">_sim</a></tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">s2</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="similarity.SIMILARITY.ncs" class="py-name" href="#" onclick="return doclink('link-47', 'ncs', 'link-9');">ncs</a></tt> <tt class="py-op">)</tt> </tt>
</div><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.cmid"></a><div id="SIMILARITY.cmid-def"><a name="L125"></a><tt class="py-lineno">125</tt> <a class="py-toggle" href="#" id="SIMILARITY.cmid-toggle" onclick="return toggle('SIMILARITY.cmid');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#cmid">cmid</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">,</tt> <tt class="py-param">s2</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.cmid-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.cmid-expanded"><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="similarity.SIMILARITY._sim" class="py-name" href="#" onclick="return doclink('link-48', '_sim', 'link-44');">_sim</a></tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">s2</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="similarity.SIMILARITY.cmid" class="py-name" href="#" onclick="return doclink('link-49', 'cmid', 'link-10');">cmid</a></tt> <tt class="py-op">)</tt> </tt>
</div><a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.entropy"></a><div id="SIMILARITY.entropy-def"><a name="L128"></a><tt class="py-lineno">128</tt> <a class="py-toggle" href="#" id="SIMILARITY.entropy-toggle" onclick="return toggle('SIMILARITY.entropy');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#entropy">entropy</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.entropy-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.entropy-expanded"><a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">        <tt id="link-50" class="py-name"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-50', 'res', 'link-24');">res</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="similarity.SIMILARITY.entropy" class="py-name" href="#" onclick="return doclink('link-51', 'entropy', 'link-11');">entropy</a></tt><tt class="py-op">(</tt> <tt class="py-name">cast</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-52" class="py-name"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-52', 'res', 'link-24');">res</a></tt> </tt>
</div><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"> </tt>
<a name="SIMILARITY.levenshtein"></a><div id="SIMILARITY.levenshtein-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="SIMILARITY.levenshtein-toggle" onclick="return toggle('SIMILARITY.levenshtein');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#levenshtein">levenshtein</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">,</tt> <tt class="py-param">s2</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.levenshtein-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.levenshtein-expanded"><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">        <tt id="link-53" class="py-name"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-53', 'res', 'link-24');">res</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="similarity.SIMILARITY.levenshtein" class="py-name" href="#" onclick="return doclink('link-54', 'levenshtein', 'link-12');">levenshtein</a></tt><tt class="py-op">(</tt> <tt class="py-name">cast</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt> <tt class="py-name">s1</tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">cast</tt><tt class="py-op">(</tt> <tt class="py-name">s2</tt><tt class="py-op">,</tt> <tt class="py-name">c_void_p</tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt> <tt class="py-name">s2</tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-55" class="py-name"><a title="similarity.LIBSIMILARITY_T.res" class="py-name" href="#" onclick="return doclink('link-55', 'res', 'link-24');">res</a></tt> </tt>
</div><a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">     </tt>
<a name="SIMILARITY.set_compress_type"></a><div id="SIMILARITY.set_compress_type-def"><a name="L136"></a><tt class="py-lineno">136</tt> <a class="py-toggle" href="#" id="SIMILARITY.set_compress_type-toggle" onclick="return toggle('SIMILARITY.set_compress_type');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="similarity.SIMILARITY-class.html#set_compress_type">set_compress_type</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">t</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SIMILARITY.set_compress_type-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SIMILARITY.set_compress_type-expanded"><a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">=</tt> <tt class="py-name">t</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_u</tt><tt class="py-op">.</tt><tt id="link-56" class="py-name"><a title="similarity.SIMILARITY.set_compress_type" class="py-name" href="#" onclick="return doclink('link-56', 'set_compress_type', 'link-20');">set_compress_type</a></tt><tt class="py-op">(</tt><tt class="py-name">t</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/androguard/">Androguard</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed May 18 15:57:05 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
